//
//  FinishedTableViewCell.m
//  JiuKuGospel
//
//  Created by jiukuyinyue on 15-11-9.
//  Copyright (c) 2015年 JiuKuForApp. All rights reserved.
//

#import "FinishedTableViewCell.h"

@implementation FinishedTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setFileModel:(JKFileModel *)fileModel
{
    [self setupUI:fileModel];
}

- (void)setupUI:(JKFileModel *)fileModel
{
    self.backgroundColor = [UIColor clearColor];
    [self.allView removeFromSuperview];
    self.allView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    [self addSubview:self.allView];
    
    self.songNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, _allView.width-80, 20)];
    _songNameLabel.font = FONT_16;
//    _songNameLabel.text = fileModel.fileName;
    [_allView addSubview:_songNameLabel];
    
    self.selectImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_songNameLabel.left, _songNameLabel.bottom+3, 10, 10)];
    _selectImageView.image = [UIImage imageNamed:@"download_icon_no@3x.png"];
    [_allView addSubview:_selectImageView];
    
    self.zjNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_selectImageView.right+5, _songNameLabel.bottom, _songNameLabel.width-_selectImageView.right-5, 20)];
    _zjNameLabel.font = FONT_12;
//    _zjNameLabel.text = fileModel.zjname;
    _zjNameLabel.textColor = [UIColor grayColor];
    [_allView addSubview:_zjNameLabel];
    
    self.deleteView = [[UIView alloc] initWithFrame:CGRectMake(_allView.width-60, 0, 50, _allView.height)];
    UIImageView * delectImage = [[UIImageView alloc] initWithFrame:CGRectMake((_deleteView.width-15)/2, (_deleteView.height-15)/2, 15, 15)];
    delectImage.image = [UIImage imageNamed:@"delete@3x.png"];
    [_deleteView addSubview:delectImage];
    [_allView addSubview:_deleteView];
}

@end
